package com.example.wecompose.data

import androidx.annotation.DrawableRes
import com.example.wecompose.R

enum class WeContactFeature(
    val displayName: String,
    @DrawableRes val iconRes: Int?=null
) {
    NEW_FRIENDS(
        displayName = "新的朋友",
        iconRes = R.drawable.ic_new_friend
    ),
    CHATS_ONLY(
        displayName = "仅聊天",
        iconRes = R.drawable.ic_just_chat
    ),
    GROUP_CHATS(
        displayName = "群聊",
        iconRes = R.drawable.ic_group_chat
    ),
    TAGS(
        displayName = "标签",
        iconRes = R.drawable.ic_tags
    ),
    OFFICIAL_ACCOUNTS(
        displayName = "公众号",
        iconRes = R.drawable.ic_gongzong
    );

    //根据显示名称查找枚举
    companion object{
        fun fromDisplayName(name: String): WeContactFeature? {
            return entries.find { it.displayName == name }
        }
    }
}